<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>	
<%@ include file="/pub/headmeta.jsp" %>
</head>
<body class="edit-bgr-color">
	<div class="right-head"><span class="right-head-font">消息管理&nbsp;&gt;&nbsp;导入消息</span></div>
	<div align="center" style="width: 98%">	
		<form id="addForm" method="post" enctype="multipart/form-data">		
			<table cellpadding="5" style="width: 600px; font-size: 12px;">
				<tr>
					<td width="35%" align="right">消息文件：</td>
					<td width="65%" align="left"><input type="file" name="file" id="file"/>&nbsp;&nbsp;<font color='red'>*</font></td>					
				</tr>
				<tr>
					<td width="35%" align="right">接收者：</td>
					<td width="65%" align="left">			
					<select id="user"  name="user" >
						<c:forEach var="it" items="${item}" varStatus="status">
							<option value="${it.account}">${it.name}</option>
						</c:forEach>
					</select>
					</td>					
				</tr>
			</table>
			<div class="edit-line"></div>	
			<input  type="button" class="button-1" value="导入" onclick="doImport();"/>
			<input  type="button" class="button-1" value="重置" onclick="resetEx(this.form);"/>						
			<input  type="button" class="button-1" value="返回" onclick="back();"/>
		</form>
	</div>
</body>
</html>
<script type="text/javascript">
<!--

//导入
function doImport() {
	var user = document.getElementById("user").value;
	if ($("#file").val()== ""){
		alert('分群文件不能为空！');
		return;
	}	
	var url="${ctx}/msgGroup!imp.action?user="+user;
	$.uploadEx({        
        url: url, 
        formId: "addForm",
        dataType: 'json',
        onComplate: function(json) {
        	if (json.code==0) {	        		
        		back();
    		}else{
    			alert('导入失败！');
    		}
        }
	});
}

//返回
function back(){
	history.back();
}
//-->
</script>
